package com.j283_5.wisdom_park.controller.confcenter_management.project;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.mapper.ProjectMapper;
import com.j283_5.wisdom_park.pojo.Project;
import com.j283_5.wisdom_park.pojo.Roleinfo;
import com.j283_5.wisdom_park.service.ProjectService;
import com.j283_5.wisdom_park.vo.confcenter_management.ProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author laoda
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/project")
@Api(value = "项目信息管理",tags = "项目信息管理",produces = "罗移筵")
public class ProjectController {
    @Resource
    private ProjectMapper mapper;
    @Resource
    private ProjectService projectService;

    /**
     * 多条件查询所有项目
     * @param page
     * @param project
     * @return
     */

    @RequestMapping(value="/projectInfo",method = RequestMethod.GET)
    @ApiOperation(value = "多条件查询所有项目",notes = "多条件查询所有项目(分页)",produces = "罗移筵",response = ResultData.class)
    public ResultData projectInfo(@Param("page") Page<Project> page, Project project){
        return projectService.getProjectPage(page,project);
    }


    /**
     * 添加项目详细信息
     * @param projectVo
     * @return
     */
    @RequestMapping(value = "/addProjectInfo",method = RequestMethod.POST)
    @ApiOperation(value = "添加项目详细信息",notes = "添加项目详细信息",produces = "罗移筵",response = ResultData.class)
    public ResultData addProjectInfo(@RequestBody ProjectVo projectVo){
        return projectService.addProjectInfo(projectVo);
    }

    /**
     * 删除项目信息
     * @param proIdlist
     * @return
     */
    @RequestMapping(value = "/deleteProjectInfo",method = RequestMethod.POST)
    @ApiOperation(value = "删除项目信息",notes = "删除项目信息",produces = "罗移筵",response = ResultData.class)
    public ResultData deleteProjectInfo(@RequestBody ArrayList<Integer> proIdlist){
        return projectService.deleteProjectInfo(proIdlist);
    }

    /**
     * 修改项目信息
     * @param project
     * @return
     */
    @RequestMapping(value = "/updateProjectInfo",method = RequestMethod.POST)
    @ApiOperation(value = "修改项目信息",notes = "修改项目信息",produces = "罗移筵",response = ResultData.class)
    public ResultData updateProjectInfo(@RequestBody Project project){
        return projectService.updateProjectInfo(project);
    }


}

